<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="tag" uri="http://www.springframework.org/tags" %>
<html>
    <head>
        <link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/views/includes/css/style.css" />
        <title><tag:message code="login.title"/></title>
    </head>
    <body>
        <div id="app-login">
        <c:if test="${not empty param.error}">
            <font color="red">
                Błąd logowania! <br/>
                <tag:message code="login.error" />
            </font>
        </c:if>
        
        <h1>Konta użytkowników</h1>
        <ul>
            <li>admin - admin ->admin</li>
            <li>user - user ->czytacz</li>
        </ul>
        
        <form method="POST" action="<c:url value="/j_spring_security_check" />">
            <table>
                <tr>
                    <td align="right"><tag:message code="login.username"/></td>
                    <td><input type="text" name="j_username" /></td>
                </tr>
                <tr>
                    <td align="right"><tag:message code="login.password"/></td>
                    <td><input type="password" name="j_password" /></td>
                </tr>
                <tr>
                    <td align="right"><tag:message code="login.rememberme"/></td>
                    <td><input type="checkbox" name="_spring_security_remember_me" /></td>
                </tr>
                <tr>
                    <td colspan="2" align="right">
                        <input type="submit" value="Login" />
                        <input type="reset" value="Reset" />
                </tr>
            </table>
            
            <a id="administrator" href="<%= request.getContextPath() %>/administrator/add.html">
                <tag:message code="login.adduser"/>
            </a>
            </div>
    </body>
</html>
